ARG JAVA_V=8.472-d132slim
FROM registry.cn-hangzhou.aliyuncs.com/xiaoyilin/temurin-jdk:${JAVA_V}
ARG SCALA_V=2.12.21
# 2
ADD scala-${SCALA_V}.tgz /usr/local/
ENV SCALA_HOME=/usr/local/scala-$SCALA_V
# 3
# ADD scala3-${SCALA_V}.tar.gz /usr/local/
# ENV SCALA_HOME=/usr/local/scala3-$SCALA_V
#
ENV PATH=$SCALA_HOME/bin:$PATH
WORKDIR /usr/local/
CMD ["scala","-version"]

# https://github.com/scala/scala
# https://github.com/scala/scala3
# SCALA和JDK兼容性
# https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html
# SCALA2.12
# JDK8
# docker build --build-arg JAVA_V=8.472-d132slim --build-arg SCALA_V=2.12.21 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk8.472-2.12.21 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk8.472-2.12.21
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk8.472-2.12.21
# JDK11
# docker build --build-arg JAVA_V=11.0.29-d132slim --build-arg SCALA_V=2.12.21 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk11.0.29-2.12.21 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk11.0.29-2.12.21
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk11.0.29-2.12.21
# JDK17
# docker build --build-arg JAVA_V=17.0.17-d132slim --build-arg SCALA_V=2.12.21 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk17.0.17-2.12.21 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk17.0.17-2.12.21
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk17.0.17-2.12.21
# JDK21
# docker build --build-arg JAVA_V=21.0.9-d132slim --build-arg SCALA_V=2.12.21 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk21.0.9-2.12.21 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk21.0.9-2.12.21
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk21.0.9-2.12.21
# JDK25
# docker build --build-arg JAVA_V=25.0.1-d132slim --build-arg SCALA_V=2.12.21 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk25.0.1-2.12.21 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk25.0.1-2.12.21
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala212:jdk25.0.1-2.12.21

# SCALA2.13
# JDK8
# docker build --build-arg JAVA_V=8.472-d132slim --build-arg SCALA_V=2.13.18 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk8.472-2.13.18 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk8.472-2.13.18
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk8.472-2.13.18
# JDK11
# docker build --build-arg JAVA_V=11.0.29-d132slim --build-arg SCALA_V=2.13.18 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk11.0.29-2.13.18 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk11.0.29-2.13.18
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk11.0.29-2.13.18
# JDK17
# docker build --build-arg JAVA_V=17.0.17-d132slim --build-arg SCALA_V=2.13.18 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk17.0.17-2.13.18 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk17.0.17-2.13.18
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk17.0.17-2.13.18
# JDK21
# docker build --build-arg JAVA_V=21.0.9-d132slim --build-arg SCALA_V=2.13.18 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk21.0.9-2.13.18 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk21.0.9-2.13.18
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk21.0.9-2.13.18
# JDK25
# docker build --build-arg JAVA_V=25.0.1-d132slim --build-arg SCALA_V=2.13.18 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk25.0.1-2.13.18 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk25.0.1-2.13.18
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala213:jdk25.0.1-2.13.18

# SCALA3.3
# JDK8
# docker build --build-arg JAVA_V=8.472-d132slim --build-arg SCALA_V=3.3.7 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk8.472-3.3.7 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk8.472-3.3.7
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk8.472-3.3.7
# JDK11
# docker build --build-arg JAVA_V=11.0.29-d132slim --build-arg SCALA_V=3.3.7 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk11.0.29-3.3.7 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk11.0.29-3.3.7
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk11.0.29-3.3.7
# JDK17
# docker build --build-arg JAVA_V=17.0.17-d132slim --build-arg SCALA_V=3.3.7 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk17.0.17-3.3.7 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk17.0.17-3.3.7
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk17.0.17-3.3.7
# JDK21
# docker build --build-arg JAVA_V=21.0.9-d132slim --build-arg SCALA_V=3.3.7 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk21.0.9-3.3.7 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk21.0.9-3.3.7
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk21.0.9-3.3.7
# JDK25
# docker build --build-arg JAVA_V=25.0.1-d132slim --build-arg SCALA_V=3.3.7 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk25.0.1-3.3.7 .
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk25.0.1-3.3.7
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/scala33:jdk25.0.1-3.3.7